package com.dun.java.main;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.dun.java.service.UserService;
import com.dun.java.vo.User;

@Controller
public class MainController {

	@Autowired
	private UserService userService;

	@RequestMapping("display")
	public String display(Model model ) {

		//ModelAndView model = new ModelAndView();
		List<User> userList = userService.getUsers();
		model.addAttribute("userList", userList.size());
		System.out.println("userList.size()--" + userList.size());
		return "display";
	}
}
